// $ANTLR 2.7.7 (20080611): "sim2d.g" -> "sim2dParser.java"$

import antlr.TokenBuffer;
import antlr.TokenStreamException;
import antlr.TokenStreamIOException;
import antlr.ANTLRException;
import antlr.LLkParser;
import antlr.Token;
import antlr.TokenStream;
import antlr.RecognitionException;
import antlr.NoViableAltException;
import antlr.MismatchedTokenException;
import antlr.SemanticException;
import antlr.ParserSharedInputState;
import antlr.collections.impl.BitSet;
import antlr.collections.AST;
import java.util.Hashtable;
import antlr.ASTFactory;
import antlr.ASTPair;
import antlr.collections.impl.ASTArray;

public class sim2dParser extends antlr.LLkParser       implements sim2dLexerTokenTypes
 {

protected sim2dParser(TokenBuffer tokenBuf, int k) {
  super(tokenBuf,k);
  tokenNames = _tokenNames;
  buildTokenTypeASTClassMap();
  astFactory = new ASTFactory(getTokenTypeToASTClassMap());
}

public sim2dParser(TokenBuffer tokenBuf) {
  this(tokenBuf,2);
}

protected sim2dParser(TokenStream lexer, int k) {
  super(lexer,k);
  tokenNames = _tokenNames;
  buildTokenTypeASTClassMap();
  astFactory = new ASTFactory(getTokenTypeToASTClassMap());
}

public sim2dParser(TokenStream lexer) {
  this(lexer,2);
}

public sim2dParser(ParserSharedInputState state) {
  super(state,2);
  tokenNames = _tokenNames;
  buildTokenTypeASTClassMap();
  astFactory = new ASTFactory(getTokenTypeToASTClassMap());
}

	public final void file() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST file_AST = null;
		
		try {      // for error handling
			{
			int _cnt61=0;
			_loop61:
			do {
				switch ( LA(1)) {
				case LITERAL_object:
				{
					object_stmt();
					astFactory.addASTChild(currentAST, returnAST);
					break;
				}
				case LITERAL_func:
				{
					func_def();
					astFactory.addASTChild(currentAST, returnAST);
					break;
				}
				case LITERAL_rule:
				{
					rule_stmt();
					astFactory.addASTChild(currentAST, returnAST);
					break;
				}
				default:
				{
					if ( _cnt61>=1 ) { break _loop61; } else {throw new NoViableAltException(LT(1), getFilename());}
				}
				}
				_cnt61++;
			} while (true);
			}
			match(Token.EOF_TYPE);
			file_AST = (AST)currentAST.root;
			file_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(STATEMENTS,"FILE")).add(file_AST));
			currentAST.root = file_AST;
			currentAST.child = file_AST!=null &&file_AST.getFirstChild()!=null ?
				file_AST.getFirstChild() : file_AST;
			currentAST.advanceChildToEnd();
			file_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_0);
		}
		returnAST = file_AST;
	}
	
	public final void object_stmt() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST object_stmt_AST = null;
		
		try {      // for error handling
			AST tmp31_AST = null;
			tmp31_AST = astFactory.create(LT(1));
			astFactory.makeASTRoot(currentAST, tmp31_AST);
			match(LITERAL_object);
			AST tmp32_AST = null;
			tmp32_AST = astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp32_AST);
			match(ID);
			match(35);
			{
			_loop65:
			do {
				if ((LA(1)==ID)) {
					assign_stmt();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop65;
				}
				
			} while (true);
			}
			match(36);
			object_stmt_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
		returnAST = object_stmt_AST;
	}
	
	public final void func_def() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST func_def_AST = null;
		
		try {      // for error handling
			AST tmp35_AST = null;
			tmp35_AST = astFactory.create(LT(1));
			astFactory.makeASTRoot(currentAST, tmp35_AST);
			match(LITERAL_func);
			id();
			astFactory.addASTChild(currentAST, returnAST);
			func_def_args();
			astFactory.addASTChild(currentAST, returnAST);
			match(35);
			{
			seq_of_stmts();
			astFactory.addASTChild(currentAST, returnAST);
			}
			match(36);
			func_def_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_2);
		}
		returnAST = func_def_AST;
	}
	
	public final void rule_stmt() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST rule_stmt_AST = null;
		
		try {      // for error handling
			AST tmp38_AST = null;
			tmp38_AST = astFactory.create(LT(1));
			astFactory.makeASTRoot(currentAST, tmp38_AST);
			match(LITERAL_rule);
			AST tmp39_AST = null;
			tmp39_AST = astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp39_AST);
			match(ID);
			match(35);
			{
			seq_of_stmts();
			astFactory.addASTChild(currentAST, returnAST);
			}
			match(36);
			rule_stmt_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_2);
		}
		returnAST = rule_stmt_AST;
	}
	
	public final void any_stmt() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST any_stmt_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case LITERAL_object:
			{
				object_stmt();
				astFactory.addASTChild(currentAST, returnAST);
				any_stmt_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_if:
			{
				if_stmt();
				astFactory.addASTChild(currentAST, returnAST);
				any_stmt_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_return:
			{
				return_stmt();
				astFactory.addASTChild(currentAST, returnAST);
				any_stmt_AST = (AST)currentAST.root;
				break;
			}
			default:
				if ((LA(1)==ID) && (LA(2)==DEREF||LA(2)==40)) {
					assign_stmt();
					astFactory.addASTChild(currentAST, returnAST);
					any_stmt_AST = (AST)currentAST.root;
				}
				else if ((LA(1)==ID) && (LA(2)==43)) {
					function_stmt();
					astFactory.addASTChild(currentAST, returnAST);
					any_stmt_AST = (AST)currentAST.root;
				}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_3);
		}
		returnAST = any_stmt_AST;
	}
	
	public final void if_stmt() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST if_stmt_AST = null;
		
		try {      // for error handling
			AST tmp42_AST = null;
			tmp42_AST = astFactory.create(LT(1));
			astFactory.makeASTRoot(currentAST, tmp42_AST);
			match(LITERAL_if);
			expr();
			astFactory.addASTChild(currentAST, returnAST);
			match(35);
			{
			seq_of_stmts();
			astFactory.addASTChild(currentAST, returnAST);
			}
			match(36);
			{
			switch ( LA(1)) {
			case LITERAL_else:
			{
				match(LITERAL_else);
				match(35);
				{
				_loop75:
				do {
					if ((LA(1)==ID) && (LA(2)==DEREF||LA(2)==40)) {
						assign_stmt();
						astFactory.addASTChild(currentAST, returnAST);
					}
					else if ((LA(1)==LITERAL_if)) {
						if_stmt();
						astFactory.addASTChild(currentAST, returnAST);
					}
					else if ((LA(1)==ID) && (LA(2)==43)) {
						function_stmt();
						astFactory.addASTChild(currentAST, returnAST);
					}
					else {
						break _loop75;
					}
					
				} while (true);
				}
				match(36);
				break;
			}
			case ID:
			case LITERAL_object:
			case 36:
			case LITERAL_if:
			case LITERAL_return:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			if_stmt_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_3);
		}
		returnAST = if_stmt_AST;
	}
	
	public final void assign_stmt() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST assign_stmt_AST = null;
		
		try {      // for error handling
			id();
			astFactory.addASTChild(currentAST, returnAST);
			AST tmp48_AST = null;
			tmp48_AST = astFactory.create(LT(1));
			astFactory.makeASTRoot(currentAST, tmp48_AST);
			match(40);
			expr();
			astFactory.addASTChild(currentAST, returnAST);
			match(SEMI);
			assign_stmt_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_3);
		}
		returnAST = assign_stmt_AST;
	}
	
	public final void return_stmt() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST return_stmt_AST = null;
		
		try {      // for error handling
			AST tmp50_AST = null;
			tmp50_AST = astFactory.create(LT(1));
			astFactory.makeASTRoot(currentAST, tmp50_AST);
			match(LITERAL_return);
			{
			switch ( LA(1)) {
			case ID:
			case NUMBER:
			case STRING:
			case 43:
			case 47:
			case 48:
			case LITERAL_true:
			case LITERAL_false:
			{
				expr();
				astFactory.addASTChild(currentAST, returnAST);
				break;
			}
			case SEMI:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(SEMI);
			return_stmt_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_3);
		}
		returnAST = return_stmt_AST;
	}
	
	public final void function_stmt() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST function_stmt_AST = null;
		
		try {      // for error handling
			function();
			astFactory.addASTChild(currentAST, returnAST);
			match(SEMI);
			function_stmt_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_3);
		}
		returnAST = function_stmt_AST;
	}
	
	public final void seq_of_stmts() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST seq_of_stmts_AST = null;
		
		try {      // for error handling
			{
			_loop68:
			do {
				if ((_tokenSet_4.member(LA(1)))) {
					any_stmt();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop68;
				}
				
			} while (true);
			}
			seq_of_stmts_AST = (AST)currentAST.root;
			seq_of_stmts_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(STATEMENTS,"SEQ_OF_STMTS")).add(seq_of_stmts_AST));
			currentAST.root = seq_of_stmts_AST;
			currentAST.child = seq_of_stmts_AST!=null &&seq_of_stmts_AST.getFirstChild()!=null ?
				seq_of_stmts_AST.getFirstChild() : seq_of_stmts_AST;
			currentAST.advanceChildToEnd();
			seq_of_stmts_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_5);
		}
		returnAST = seq_of_stmts_AST;
	}
	
	public final void expr() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST expr_AST = null;
		
		try {      // for error handling
			and_expr();
			astFactory.addASTChild(currentAST, returnAST);
			{
			_loop98:
			do {
				if ((LA(1)==LITERAL_or)) {
					AST tmp53_AST = null;
					tmp53_AST = astFactory.create(LT(1));
					astFactory.makeASTRoot(currentAST, tmp53_AST);
					match(LITERAL_or);
					and_expr();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop98;
				}
				
			} while (true);
			}
			expr_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_6);
		}
		returnAST = expr_AST;
	}
	
	public final void id() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST id_AST = null;
		
		try {      // for error handling
			AST tmp54_AST = null;
			tmp54_AST = astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp54_AST);
			match(ID);
			{
			_loop95:
			do {
				if ((LA(1)==DEREF)) {
					AST tmp55_AST = null;
					tmp55_AST = astFactory.create(LT(1));
					astFactory.makeASTRoot(currentAST, tmp55_AST);
					match(DEREF);
					AST tmp56_AST = null;
					tmp56_AST = astFactory.create(LT(1));
					astFactory.addASTChild(currentAST, tmp56_AST);
					match(ID);
				}
				else {
					break _loop95;
				}
				
			} while (true);
			}
			id_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_7);
		}
		returnAST = id_AST;
	}
	
	public final void func_def_args() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST func_def_args_AST = null;
		
		try {      // for error handling
			match(43);
			{
			switch ( LA(1)) {
			case ID:
			{
				farg_list();
				astFactory.addASTChild(currentAST, returnAST);
				break;
			}
			case 44:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(44);
			func_def_args_AST = (AST)currentAST.root;
			func_def_args_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(FUNC_DEF_ARGS)).add(func_def_args_AST));
			currentAST.root = func_def_args_AST;
			currentAST.child = func_def_args_AST!=null &&func_def_args_AST.getFirstChild()!=null ?
				func_def_args_AST.getFirstChild() : func_def_args_AST;
			currentAST.advanceChildToEnd();
			func_def_args_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_8);
		}
		returnAST = func_def_args_AST;
	}
	
	public final void farg_list() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST farg_list_AST = null;
		
		try {      // for error handling
			AST tmp59_AST = null;
			tmp59_AST = astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp59_AST);
			match(ID);
			{
			_loop89:
			do {
				if ((LA(1)==COMMA)) {
					match(COMMA);
					AST tmp61_AST = null;
					tmp61_AST = astFactory.create(LT(1));
					astFactory.addASTChild(currentAST, tmp61_AST);
					match(ID);
				}
				else {
					break _loop89;
				}
				
			} while (true);
			}
			farg_list_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_9);
		}
		returnAST = farg_list_AST;
	}
	
	public final void function() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST function_AST = null;
		
		try {      // for error handling
			AST tmp62_AST = null;
			tmp62_AST = astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp62_AST);
			match(ID);
			args();
			astFactory.addASTChild(currentAST, returnAST);
			function_AST = (AST)currentAST.root;
			function_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(FUNCTION)).add(function_AST));
			currentAST.root = function_AST;
			currentAST.child = function_AST!=null &&function_AST.getFirstChild()!=null ?
				function_AST.getFirstChild() : function_AST;
			currentAST.advanceChildToEnd();
			function_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_10);
		}
		returnAST = function_AST;
	}
	
	public final void args() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST args_AST = null;
		
		try {      // for error handling
			match(43);
			{
			switch ( LA(1)) {
			case ID:
			case NUMBER:
			case STRING:
			case 43:
			case 47:
			case 48:
			case LITERAL_true:
			case LITERAL_false:
			{
				arg_list();
				astFactory.addASTChild(currentAST, returnAST);
				break;
			}
			case 44:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(44);
			args_AST = (AST)currentAST.root;
			args_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(ARGS)).add(args_AST));
			currentAST.root = args_AST;
			currentAST.child = args_AST!=null &&args_AST.getFirstChild()!=null ?
				args_AST.getFirstChild() : args_AST;
			currentAST.advanceChildToEnd();
			args_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_10);
		}
		returnAST = args_AST;
	}
	
	public final void arg_list() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST arg_list_AST = null;
		
		try {      // for error handling
			expr();
			astFactory.addASTChild(currentAST, returnAST);
			{
			_loop92:
			do {
				if ((LA(1)==COMMA)) {
					match(COMMA);
					expr();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop92;
				}
				
			} while (true);
			}
			arg_list_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_9);
		}
		returnAST = arg_list_AST;
	}
	
	public final void and_expr() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST and_expr_AST = null;
		
		try {      // for error handling
			comp_expr();
			astFactory.addASTChild(currentAST, returnAST);
			{
			_loop101:
			do {
				if ((LA(1)==LITERAL_and)) {
					AST tmp66_AST = null;
					tmp66_AST = astFactory.create(LT(1));
					astFactory.makeASTRoot(currentAST, tmp66_AST);
					match(LITERAL_and);
					comp_expr();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop101;
				}
				
			} while (true);
			}
			and_expr_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_11);
		}
		returnAST = and_expr_AST;
	}
	
	public final void comp_expr() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST comp_expr_AST = null;
		
		try {      // for error handling
			plus_minus_expr();
			astFactory.addASTChild(currentAST, returnAST);
			{
			switch ( LA(1)) {
			case EQ:
			case NEQ:
			case LT:
			case GT:
			case LTEQ:
			case GTEQ:
			{
				{
				switch ( LA(1)) {
				case EQ:
				{
					AST tmp67_AST = null;
					tmp67_AST = astFactory.create(LT(1));
					astFactory.makeASTRoot(currentAST, tmp67_AST);
					match(EQ);
					break;
				}
				case NEQ:
				{
					AST tmp68_AST = null;
					tmp68_AST = astFactory.create(LT(1));
					astFactory.makeASTRoot(currentAST, tmp68_AST);
					match(NEQ);
					break;
				}
				case LT:
				{
					AST tmp69_AST = null;
					tmp69_AST = astFactory.create(LT(1));
					astFactory.makeASTRoot(currentAST, tmp69_AST);
					match(LT);
					break;
				}
				case GT:
				{
					AST tmp70_AST = null;
					tmp70_AST = astFactory.create(LT(1));
					astFactory.makeASTRoot(currentAST, tmp70_AST);
					match(GT);
					break;
				}
				case LTEQ:
				{
					AST tmp71_AST = null;
					tmp71_AST = astFactory.create(LT(1));
					astFactory.makeASTRoot(currentAST, tmp71_AST);
					match(LTEQ);
					break;
				}
				case GTEQ:
				{
					AST tmp72_AST = null;
					tmp72_AST = astFactory.create(LT(1));
					astFactory.makeASTRoot(currentAST, tmp72_AST);
					match(GTEQ);
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				plus_minus_expr();
				astFactory.addASTChild(currentAST, returnAST);
				break;
			}
			case COMMA:
			case SEMI:
			case 35:
			case 44:
			case LITERAL_or:
			case LITERAL_and:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			comp_expr_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_12);
		}
		returnAST = comp_expr_AST;
	}
	
	public final void plus_minus_expr() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST plus_minus_expr_AST = null;
		
		try {      // for error handling
			mult_div_expr();
			astFactory.addASTChild(currentAST, returnAST);
			{
			_loop108:
			do {
				if ((LA(1)==47||LA(1)==48)) {
					{
					switch ( LA(1)) {
					case 47:
					{
						AST tmp73_AST = null;
						tmp73_AST = astFactory.create(LT(1));
						astFactory.makeASTRoot(currentAST, tmp73_AST);
						match(47);
						break;
					}
					case 48:
					{
						AST tmp74_AST = null;
						tmp74_AST = astFactory.create(LT(1));
						astFactory.makeASTRoot(currentAST, tmp74_AST);
						match(48);
						break;
					}
					default:
					{
						throw new NoViableAltException(LT(1), getFilename());
					}
					}
					}
					mult_div_expr();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop108;
				}
				
			} while (true);
			}
			plus_minus_expr_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_13);
		}
		returnAST = plus_minus_expr_AST;
	}
	
	public final void mult_div_expr() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST mult_div_expr_AST = null;
		
		try {      // for error handling
			sign_expr();
			astFactory.addASTChild(currentAST, returnAST);
			{
			_loop112:
			do {
				if ((LA(1)==49||LA(1)==50)) {
					{
					switch ( LA(1)) {
					case 49:
					{
						AST tmp75_AST = null;
						tmp75_AST = astFactory.create(LT(1));
						astFactory.makeASTRoot(currentAST, tmp75_AST);
						match(49);
						break;
					}
					case 50:
					{
						AST tmp76_AST = null;
						tmp76_AST = astFactory.create(LT(1));
						astFactory.makeASTRoot(currentAST, tmp76_AST);
						match(50);
						break;
					}
					default:
					{
						throw new NoViableAltException(LT(1), getFilename());
					}
					}
					}
					sign_expr();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop112;
				}
				
			} while (true);
			}
			mult_div_expr_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_14);
		}
		returnAST = mult_div_expr_AST;
	}
	
	public final void sign_expr() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST sign_expr_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case 47:
			{
				match(47);
				deref_expr();
				astFactory.addASTChild(currentAST, returnAST);
				sign_expr_AST = (AST)currentAST.root;
				sign_expr_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(UPLUS,"UPLUS")).add(sign_expr_AST));
				currentAST.root = sign_expr_AST;
				currentAST.child = sign_expr_AST!=null &&sign_expr_AST.getFirstChild()!=null ?
					sign_expr_AST.getFirstChild() : sign_expr_AST;
				currentAST.advanceChildToEnd();
				sign_expr_AST = (AST)currentAST.root;
				break;
			}
			case 48:
			{
				match(48);
				deref_expr();
				astFactory.addASTChild(currentAST, returnAST);
				sign_expr_AST = (AST)currentAST.root;
				sign_expr_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(UMINUS,"UMINUS")).add(sign_expr_AST));
				currentAST.root = sign_expr_AST;
				currentAST.child = sign_expr_AST!=null &&sign_expr_AST.getFirstChild()!=null ?
					sign_expr_AST.getFirstChild() : sign_expr_AST;
				currentAST.advanceChildToEnd();
				sign_expr_AST = (AST)currentAST.root;
				break;
			}
			case ID:
			case NUMBER:
			case STRING:
			case 43:
			case LITERAL_true:
			case LITERAL_false:
			{
				deref_expr();
				astFactory.addASTChild(currentAST, returnAST);
				sign_expr_AST = (AST)currentAST.root;
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_15);
		}
		returnAST = sign_expr_AST;
	}
	
	public final void deref_expr() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST deref_expr_AST = null;
		
		try {      // for error handling
			atom();
			astFactory.addASTChild(currentAST, returnAST);
			{
			_loop116:
			do {
				if ((LA(1)==51)) {
					AST tmp79_AST = null;
					tmp79_AST = astFactory.create(LT(1));
					astFactory.makeASTRoot(currentAST, tmp79_AST);
					match(51);
					atom();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop116;
				}
				
			} while (true);
			}
			deref_expr_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_15);
		}
		returnAST = deref_expr_AST;
	}
	
	public final void atom() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST atom_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case NUMBER:
			{
				AST tmp80_AST = null;
				tmp80_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp80_AST);
				match(NUMBER);
				atom_AST = (AST)currentAST.root;
				break;
			}
			case STRING:
			{
				AST tmp81_AST = null;
				tmp81_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp81_AST);
				match(STRING);
				atom_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_true:
			{
				AST tmp82_AST = null;
				tmp82_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp82_AST);
				match(LITERAL_true);
				atom_AST = (AST)currentAST.root;
				break;
			}
			case LITERAL_false:
			{
				AST tmp83_AST = null;
				tmp83_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp83_AST);
				match(LITERAL_false);
				atom_AST = (AST)currentAST.root;
				break;
			}
			case 43:
			{
				match(43);
				expr();
				astFactory.addASTChild(currentAST, returnAST);
				match(44);
				atom_AST = (AST)currentAST.root;
				break;
			}
			default:
				if ((LA(1)==ID) && (_tokenSet_16.member(LA(2)))) {
					id();
					astFactory.addASTChild(currentAST, returnAST);
					atom_AST = (AST)currentAST.root;
				}
				else if ((LA(1)==ID) && (LA(2)==43)) {
					function();
					astFactory.addASTChild(currentAST, returnAST);
					atom_AST = (AST)currentAST.root;
				}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_10);
		}
		returnAST = atom_AST;
	}
	
	
	public static final String[] _tokenNames = {
		"<0>",
		"EOF",
		"<2>",
		"NULL_TREE_LOOKAHEAD",
		"DIV",
		"STAR",
		"PLUS",
		"MINUS",
		"ASSIGN",
		"EQ",
		"NEQ",
		"LT",
		"GT",
		"LTEQ",
		"GTEQ",
		"COMMA",
		"SEMI",
		"DEREF",
		"PARENS",
		"BRACES",
		"ID",
		"NUMBER",
		"NL",
		"COMMENT",
		"STRING",
		"EXP",
		"DIGIT",
		"WS",
		"STATEMENTS",
		"FUNCTION",
		"ARGS",
		"FUNC_DEF_ARGS",
		"UPLUS",
		"UMINUS",
		"\"object\"",
		"\"{\"",
		"\"}\"",
		"\"rule\"",
		"\"if\"",
		"\"else\"",
		"\"<-\"",
		"\"func\"",
		"\"return\"",
		"\"(\"",
		"\")\"",
		"\"or\"",
		"\"and\"",
		"\"+\"",
		"\"-\"",
		"\"*\"",
		"\"/\"",
		"\".\"",
		"\"true\"",
		"\"false\"",
		"\"not\""
	};
	
	protected void buildTokenTypeASTClassMap() {
		tokenTypeToASTClassMap=null;
	};
	
	private static final long[] mk_tokenSet_0() {
		long[] data = { 2L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
	private static final long[] mk_tokenSet_1() {
		long[] data = { 7095287021570L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
	private static final long[] mk_tokenSet_2() {
		long[] data = { 2353642078210L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
	private static final long[] mk_tokenSet_3() {
		long[] data = { 4758824812544L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
	private static final long[] mk_tokenSet_4() {
		long[] data = { 4690105335808L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
	private static final long[] mk_tokenSet_5() {
		long[] data = { 68719476736L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
	private static final long[] mk_tokenSet_6() {
		long[] data = { 17626545881088L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6());
	private static final long[] mk_tokenSet_7() {
		long[] data = { 4495937405844992L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7());
	private static final long[] mk_tokenSet_8() {
		long[] data = { 34359738368L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8());
	private static final long[] mk_tokenSet_9() {
		long[] data = { 17592186044416L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9());
	private static final long[] mk_tokenSet_10() {
		long[] data = { 4486041801195008L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10());
	private static final long[] mk_tokenSet_11() {
		long[] data = { 52810917969920L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11());
	private static final long[] mk_tokenSet_12() {
		long[] data = { 123179662147584L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12());
	private static final long[] mk_tokenSet_13() {
		long[] data = { 123179662179840L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13());
	private static final long[] mk_tokenSet_14() {
		long[] data = { 545392127245824L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_14 = new BitSet(mk_tokenSet_14());
	private static final long[] mk_tokenSet_15() {
		long[] data = { 2234241987509760L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_15 = new BitSet(mk_tokenSet_15());
	private static final long[] mk_tokenSet_16() {
		long[] data = { 4486041801326080L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_16 = new BitSet(mk_tokenSet_16());
	
	}
